package small.woods.msRedis.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import small.woods.msRedis.service.RedisLockService;

/**
 * @description: redis分布式锁的实现
 * @author: yutingting
 * @create: 2022-01-18 20:22
 **/
@Component
@EnableScheduling
public class RedisLockTask {

    @Autowired
    RedisLockService redisLockService;


    @Scheduled(cron = "0,10,20,30,40,50 * * * * ? ")
    public void start(){
        redisLockService.executeRedisLock();
    }
}
